import upload from '@/utils/upload'
import request from '@/utils/request'
import {
	methods
} from '../../uni_modules/uview-ui/libs/mixin/mixin'

// 用户密码重置
// export function updateUserPwd(oldPassword, newPassword) {
//   const data = {
//     oldPassword,
//     newPassword
//   }
//   return request({
//     url: '/system/user/profile/updatePwd',
//     method: 'put',
//     params: data
//   })
// }

// 查询用户个人信息
// export function getUserProfile() {
//   return request({
//     url: '/system/user/profile',
//     method: 'get'
//   })
// }

// 修改用户个人信息
export function updateUserProfile(data) {
	return request({
		url: '/activity/activityUser/updateUser',
		method: 'post',
		data: data
	})
}

// 图片上传
export function uploadAvatar(tempFilePaths) {
	return upload({
		url: '/activity/activityFiles/uploadFiles',
		headers: {
			isToken: true
		},
		name: "files",
		filePath: tempFilePaths
	})
}

// 删除图片(上一张头像地址)
export function deleteAvatar(tempFilePaths) {
	return request({
		url: `/activity/activityFiles/deleteFiles?deleteFiles=${tempFilePaths}`,
		method: 'delete'
	})
}
//社团认证
export function reqActivityInfo(data) {
	return request({
		'url': '/activity/sgs/authentication',
		'method': 'post',
		'data': data,
	})
}
